#pragma once

#include <iostream>
#include <memory>
#include "Epoller.hpp"
#include "Socket.hpp"
#include "Connection.hpp"
#include "common.hpp"

using namespace SocketModule;

class Listener : public Connection
{
public:
    Listener(int port)
        :_port(port)
        ,_listensock(std::make_unique<TcpSocket>())
    {
        _listensock->BuildTcpSocketMethod(_port);
        SetEvent(EPOLLIN);
        SetFd(_listensock->Fd());
    }
    
    ~Listener()
    {

    }

    void Recver()
    {

    }

    void Sender()
    {}

    void Excepter()
    {}
private:
    int _port;
    std::unique_ptr<Socket> _listensock;
};
